1. Field of the Invention
The invention relates to the detection of packets, more particularly to a method and apparatus for detecting a wake packet issued by a network device to a sleeping node.
2. Description of the Related Art
In U.S. Pat. No. 5,404,544 issued to Crayford, there is disclosed a network connection system that includes a network controller having a transceiver for connecting the network controller to a data processing network. A data processing node is connected to the network controller, and is allowed to assume a sleep mode by the network controller for power saving purposes. The data processing network is configured to repetitively signal its presence to the transceiver when the data processing node is in the sleep mode, and the data processing node is conrigured to be awakened from the sleep mode by the transceiver in response to a wake instruction that includes a node address of the data processing node, and that was received by the transceiver from the data processing network. As such, any transmission intended for the data processing node will not be missed even if the latter is in the sleep mode.
The MAGIC PACKET technology by Advanced Micro Devices was developed with the aim of waking a sleeping node on a networking environment, such as Ethernet, token ring, etc., thereby keeping the node accessible. The technology involves the sending of a specific packet of information, hereinafter referred to as a wake packet, to a selected sleeping node. A detecting apparatus of the selected sleeping node scans all incoming transmissions from a network device, and wakes up the sleeping node upon detection of the wake packet.
The wake packet generally includes a synchronization stream and a destination address stream. The synchronization stream is defined in the MAGIC PACKET technology as a predetermined number of sync duplications of a sync byte, e.g. up to six bytes of FFh, whereas the destination address stream is defined as a predetermined number of address repetitions, e.g. up to sixteen address repetitions, of a destination address assigned to the selected sleeping node, thereby improving the chances of detecting the wake packet.
FIG. 1 illustrates a conventional detecting apparatus 1 for detecting a wake packet in a network frame that was issued by a network device. The detecting apparatus 1 is shown to comprise a frame buffer 10, a search pointer control logic 11, a search pointer 12, a back-off pointer 13, a comparator 14, a pattern counter control logic 15, a pattern counter 16 and a pattern register 17.
The frame buffer 10 is used to store incoming data transmissions from the network device (not shown). The back-off pointer 13 is connected to the search pointer 12, and the search pointer 12 controls the output of data bytes from the frame buffer 10. The search pointer control logic 11 is connected to the back-off pointer 13 and the search pointer 12, and controls incrementing, loading and clearing operations of the same. The entire wake packet assigned to the corresponding node is stored in the pattern register 17. The pattern counter 16 controls the output of data bytes from the pattern register 17, and the pattern counter control logic 15 controls incrementing and clearing operations of the pattern counter 16. The comparator 14 compares the data bytes outputted by the pattern register 17 and the frame buffer 10. The output of the comparator 14 is received by the search pointer control logic 11 and the pattern counter control logic 15. When the particular wake packet that is associated with the sleeping node is detected, the pattern counter control logic 15 generates a packet detected signal for waking up the sleeping node.
A flowchart illustrating the operation of the conventional detecting apparatus 1 is shown in FIG. 2. Initially, when the detecting apparatus 1 is activated, the search pointer control logic 11 and the pattern counter control logic 15 clear the search pointer 12, the back-off pointer 13 and the pattern counter 16 in step S10. Thereafter, in step S11, the pattern counter control logic 15 detects if the associated node is in a sleep mode, and repeats the detection step until the associated node has entered into the sleep mode. In step S12, it is detected if a packet has arrived from the network device. If no, the flow goes back to step S11. If yes, the packet frame is stored in the frame buffer 10 in step S13. In step S14, if the value in the search pointer 12 has reached the end of the frame buffer 10, the flow automatically goes back to step S10. Otherwise, in step S15, the comparator 14 compares a data byte in the frame buffer 10 that is pointed to by the search pointer 12 with a data byte in the pattern register 17 that is addressed by the pattern counter 16. If no match is detected, step S16 is performed, where the search pointer control logic 11 increments the value in the back-off pointer 13 and loads the value in the back-off pointer 13 into the search pointer 12, and where the pattern counter control logic 15 clears the pattern counter 16. The flow then goes back to step S14 after step S16. If a match was detected in step S15, step S17 is performed, where the search pointer control logic 11 increments the value in the search pointer 12, and where the pattern counter control logic 15 increments the value in the pattern counter 16. In step S18, it is detected if the value in the pattern counter 16 has reached the required pattern length, i.e. the end of the pattern register 17. If no, the flow goes back to step S14. Otherwise, step sl9 is performed, where the packet detected signal is generated by the pattern counter control logic 15 to wake up the sleeping node.
As such, the detecting apparatus 1 is capable of generating the packet detected signal upon conducting a full-block matching operation to detect a wake packet that includes a predefined synchronization stream, e.g. six bytes of FFh, followed by a destination address stream, e.g. sixteen repetitions of the destination address assigned to the selected sleeping node. If the end of the frame buffer 10 was reached without detecting a specified complete wake packet, the search pointer 12, the back-off pointer 13 and the pattern counter 16 are cleared so as to prepare the detecting apparatus 1 to detect another packet frame from the network device. The back-off pointer 13 enables the detecting apparatus 1 to detect the destination address stream in the event that the synchronization stream was immediately preceded by one or more FFh data bytes.
The drawbacks of the conventional detecting apparatus 1 are as follows:
1. A large frame buffer 10, which is capable of accommodating a network frame of up to 1518 bytes in the Ethernet networking environment, is required.
2. The full-blockmatching operation employed in the conventional detecting apparatus 1 is time consuming.
3. A complex back-off mechanism, which includes the frame buffer 10, the search pointer control logic 11, the search pointer 12 and the back-off pointer 13, is in use.